//ts定义一个元素类型为string类型的变量
function f() {
    var message = "Hello, world!";
    return message;
}
f()
console.log(f());

let myPush=function(arr:number[],brr:string){
    console.log(brr);
    for (let i = 0; i < arr.length; i++) {
       console.log(arr[i]);
    }
    
    return arr.length
    
    
}
myPush([1,2,3,4,5,6],"aaa");

class Greeter {
    greeting: string;
    constructor(message: string) {
        this.greeting = message;
    }
    greet() {
        return "Hello, " + this.greeting;
    }
}

let greeter = new Greeter("world");
console.log(greeter);